<div ng-init="init()">
    <div class="modal-header">
        <h3 class="modal-title">{{title}}</h3>
    </div>
    <div class="modal-body">
        <!-- 菜品ID -->
        <div class="form-group" style="display:none">
            <label>菜品ID:</label>
            <input class="form-control" ng-model="food._id" type="text">
            <p class="help-block"></p>
        </div>
        <!-- 菜品名称 -->
        <div class="form-group" ng-class="validate.div.foodName">
            <label>菜品名称:</label>
            <input class="form-control" ng-model="food.foodName" ng-change="foodNameChange()" type="text" required>
            <span ng-class="validate.span.foodName"></span>
            <p class="help-block">{{validate.help.foodName}}</p>
        </div>
        <!-- 菜品价格 -->
        <div class="form-group" ng-class="validate.div.foodPrice">
            <label>菜品价格:</label>
            <input class="form-control" ng-model="food.foodPrice" ng-change="foodPriceChange()" type="text" required>
            <span ng-class="validate.span.foodPrice"></span>
            <p class="help-block">{{validate.help.foodPrice}}</p>
        </div>
        <!-- 菜品图片 -->
        <div class="form-group">
            <label class="control-label">菜品图片:</label>
            <div class="input-group">
                <div ng-class="validate.div.foodPic">
                    <input type="text" class="form-control" ng-model="food.foodPic" required readonly />
                </div>
                <a class="btn btn-default input-group-addon glyphicon glyphicon-search" ng-click="browse()">浏览</a>
                <a class="btn btn-default input-group-addon glyphicon glyphicon-upload" ng-click="upload()">上传</a>
            </div>
            <p class="help-block">图片请不要超过2M {{validate.help.foodPic}}</p>
            <input id="file" ng-model="food.foodPic" nv-file-select uploader="uploader" type="file" style="display:none">
        </div>
        <div class="form-group" ng-hide="hide">
            <label class="control-label">图片预览:</label>
            <div class="input-group">
                <img src="{{food.foodPic}}" width=150px height=120px/>
            </div>
        </div>
        <!-- 菜品类型 -->
        <div class="form-group" ng-class="validate.div.foodType">
            <label>菜品类型:</label>
            <select class="form-control" ng-model="food.foodType" ng-change="foodTypeChange()" required>
                <option ng-repeat="type in types" value="{{type._id}}">{{type.typeName}}</option>
            </select>
            <p class="help-block">{{validate.help.foodType}}</p>
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" ng-click="submit()">确认</button>
        <button class="btn btn-warning" ng-click="cancel()">退出</button>
    </div>
</div>